﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="ShoppingListOLD.aspx.cs" Inherits="ShoppingList" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">



    <form runat="server">
        <div>

            <asp:TextBox ID="txtSearchProduct" runat="server" Text="Søg efter et produkt" OnClick="this.value=''" CssClass="form-control"></asp:TextBox>

            <asp:Button ID="btnSearchProduct" runat="server" Text="Søg" CssClass="btn" OnClick="btnSearchProduct_Click" />

        </div>

        <div style="width: 50%; float:left;" >

            <asp:ListView ID="productList" runat="server" OnItemCommand="ProductListView_OnItemCommand" Visible="true">

                <LayoutTemplate>
                    <table runat="server" style="width: 100%; text-align: center;  border:2px solid black;">
                        <tr runat="server">
                            <td runat="server">Produkt</td>
                        </tr>
                        <tr id="ItemPlaceholder" runat="server">
                        </tr>
                    </table>

                </LayoutTemplate>
                <ItemTemplate>
                    <tr onclick=""  style="border:1px solid black;"">
                        <td>
                            <asp:LinkButton Style="display: block;" ID="lbSelect" runat="server" OnClick="addProduct" CommandArgument='<%# Eval("name") %>'>
                                <asp:Label
                                    ID="Label2"
                                    runat="server"
                                    Text='<%# Eval("name")%>'></asp:Label>
                            </asp:LinkButton>
                        </td>
                    </tr>
                </ItemTemplate>

                <EmptyDataTemplate>
                    <table runat="server" style="width: 100%; text-align: center;  border:2px solid black;">
                        <tr runat="server" style="border:1px solid black;">
                            <td runat="server">Produkt</td>
                        </tr>
                        <tr id="ItemPlaceholder" runat="server">
                        </tr>
                    </table>
                </EmptyDataTemplate>
            </asp:ListView>



        </div>


        <div id ="shoppingListDiv" style="width: 50%; float:right;">

            <asp:ListView ID="shoppingList" runat="server">

                <LayoutTemplate>
                    <table runat="server" style="width: 100%; text-align: center;  border:2px solid black;">
                        <tr runat="server">
                            <td runat="server">Indkøbsliste</td>
                        </tr>
                        <tr id="ItemPlaceholder" runat="server">
                        </tr>
                    </table>

                </LayoutTemplate>
                <ItemTemplate>
                    <tr onclick=""  style="border:1px solid black;">
                        <td>
                             <asp:LinkButton Style="display: block;" ID="lbDeselect" runat="server" OnClick="removeProduct" CommandArgument='<%# Eval("id") %>' >
                            <asp:Label
                                ID="Label1"
                                runat="server"
                                Text='<%# Eval("name")%>'>  
                            </asp:Label>
                                 </asp:LinkButton>
                        </td>
                    </tr>
                </ItemTemplate>
                <EmptyDataTemplate>
                    <table runat="server" style="width: 100%; text-align: center;  border:2px solid black;">
                        <tr runat="server" style="border:1px solid black;">
                            <td runat="server">Indkøbsliste</td>
                        </tr>
                        <tr id="ItemPlaceholder" runat="server">
                        </tr>
                    </table>
                </EmptyDataTemplate>
            </asp:ListView>

            <asp:TextBox id="txtListName" runat="server" CssClass="form-control" Text="Navngiv din indkøbsliste" OnClick="this.value=''"/>
            <asp:Button id="btnListName" runat="server" text="Klik her" OnClick="btnListName_Click" CssClass="btn"/>
            <asp:Button id="btnSaveShoppingList" runat="server" text="Gem indkøbsliste" OnClick="btnSaveShoppingList_Click" CssClass="btn"/>
            <asp:DropDownList ID="ddlSavedCookies" runat="server" OnSelectedIndexChanged="ddlSavedCookies_SelectedIndexChanged">
            </asp:DropDownList>
            
        <asp:Label ID="lblStatus" runat="server" />
        </div>







    </form>
</asp:Content>
